package cn.edu.bjut.qianrushi;

import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.design.widget.NavigationView;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import android.support.v7.widget.RecyclerView;
import android.view.MenuItem;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.Toast;


public class MainActivity extends AppCompatActivity {

    private DrawerLayout drawerLayout;
    //    private SystemBarTintManager tintManager;
    private NavigationView navigationView;
    private LinearLayout head;
    private ImageView userpicture;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

//        Window window = getWindow();
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
        drawerLayout = (DrawerLayout) findViewById(R.id.cehua);
        navigationView = (NavigationView) findViewById(R.id.nav);
        View headerView = navigationView.getHeaderView(0);//获取头布局
        head = headerView.findViewById(R.id.head);
        userpicture = headerView.findViewById(R.id.userpicture);

//        navigationView.setNavigationItemSelectedListener
//                (new NavigationView.OnNavigationItemSelectedListener() {
//
//                    @Override
//                    public boolean onNavigationItemSelected(@NonNull MenuItem item) {
//                        //item.setChecked(true);
//
//                        switch (item.getItemId()){
//                            case R.id.weixin://点击菜单，跳出侧滑菜单
//                                Toast.makeText(MainActivity.this,"假装打开了朋友圈",Toast.LENGTH_LONG).show();
//                                drawerLayout.closeDrawer(navigationView);
//                                break;
//                            case R.id.weibo://点击菜单，跳出侧滑菜单
//                                Toast.makeText(MainActivity.this,"假装打开了新浪微博",Toast.LENGTH_LONG).show();
//                                drawerLayout.closeDrawer(navigationView);
//                                break;
//                            case R.id.ditu://点击菜单，跳出侧滑菜单
//                                Toast.makeText(MainActivity.this,"假装打开了地图",Toast.LENGTH_LONG).show();
//                                drawerLayout.closeDrawer(navigationView);
//                                break;
//                            case R.id.fanyi://点击菜单，跳出侧滑菜单
////                                startActivity(new Intent(MainActivity.this,TranslateActivity.class));
//                                drawerLayout.closeDrawer(navigationView);
//                                break;
//                            case R.id.shezhi:
////                                startActivity(new Intent(MainActivity.this, SettingActivity.class));
//                                drawerLayout.closeDrawer(navigationView);
//                                break;
//                            case R.id.exit:
//                                startActivity(new Intent(MainActivity.this, LoginActivity.class));
//                                drawerLayout.closeDrawer(navigationView);
//                                finish();
//                                break;
//                        }
////
//                        return true;
//                    }
//                });

    }


}
